<template>
  <div style="background-color: #e9ecef;">
    <div class="wrap">
      <div>您的答卷已提交！感谢您的参与！</div>
      <div>
        <!-- 投票题结果展示 -->
        <!-- <StaticCard v-for="(item, index) in results" :post="item" :key="index"></StaticCard> -->
        <Statis :QID="this.QID"></Statis>
      </div>
    </div>
  </div>
</template>

<script>
import StaticCard from "../components/StaticCard.vue";
import Statis from '../components/Statis.vue';

export default {
  name: "VoteResult",
  props: {
    QID64: {
      default: -1
    }
  },
  data() {
    return {
      QID: this.$AES.decrypt(this.QID64),
      results: []
    };
  },
  components: {
    StaticCard,
    Statis
  },
  methods: {
    // getResults() {
    //   this.$serve.statisticTest(this.QID).then(res => {
    //     let temp = this.$mTool.getStaticPosts(res);
    //     let shows = res.data.showResult;
    //     temp.forEach((el, index) => {
    //       if (shows.length > index && shows[index] == true)
    //         this.results.push(el);
    //     });
    //     console.log("results:", this.results);
    //   });
      // this.results = [
      //   {
      //     id: 1,
      //     questiontitle: "请选yes或no",
      //     totalquantity: 4,
      //     answers: [
      //       { option: "A", text: "yes", quantity: 2 },
      //       { option: "B", text: "no", quantity: 2 }
      //     ]
      //   },
      //   {
      //     id: 2,
      //     questiontitle: "请选yes或no",
      //     totalquantity: 4,
      //     answers: [
      //       { option: "A", text: "yes", quantity: 2 },
      //       { option: "B", text: "no", quantity: 2 }
      //     ]
      //   }
      // ];
    // }
  },
  mounted() {
    // this.getResults();
  }
};
</script>

<style scoped>
.wrap {
  margin: 50px auto;
  padding: 15px;
  width: 50%;
}
</style>